package com.yf.exam.modules.trainingarchives.evaluation.controller;


import com.yf.exam.common.entity.Result;
import com.yf.exam.core.exception.ServiceException;
import com.yf.exam.modules.trainingarchives.evaluation.dto.EvaluationExplainDTO;
import com.yf.exam.modules.trainingarchives.evaluation.dto.EvaluationItemTemplateDTO;
import com.yf.exam.modules.trainingarchives.evaluation.service.IEvaluationItemTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * <p>
 * 满意度调查项模板表 前端控制器
 * </p>
 *
 * @author lql
 * @since 2025-01-06
 */
@Api(tags={"满意度调查项模板表"})
@RestController
@RequestMapping("/org/api/evaluation-item-template")
public class EvaluationItemTemplateController {

    @Resource
    private IEvaluationItemTemplateService evaluationItemTemplateService;
    /**
     * 添加或修改
     * @param reqDTO
     * @return
     */
    @ApiOperation(value = "添加")
    @PostMapping(value = "/save")
    public Result save(@Valid @RequestBody EvaluationItemTemplateDTO reqDTO) {

        try {
            //复制参数
            evaluationItemTemplateService.add(reqDTO);
            return Result.ok();
        }catch (ServiceException e){
            return Result.faild(e);
        }
    }
}
